#ifndef _QY_URI_H
#define _QY_URI_H

#include <string>
#include <map>
#include <list>

namespace qy
{

class URI
{
public:
	URI(const std::string &url);
	virtual ~URI();

	std::string scheme() const;
	std::string username() const;
	std::string password() const;
	std::string host() const;
	unsigned int port() const;
	std::string path() const;
	std::string fragement() const;
	std::string fullPath() const;

private:
	bool parse(const std::string &url);
	bool valid(char ch);
	
private:
	std::string m_scheme;
	std::string m_username;
	std::string m_password;
	std::string m_host;
	unsigned int m_port;
	std::list<std::string> m_path;
	std::map<std::string, std::string> m_query;
	std::string m_fragement;
};

}

#endif
